<div class="hashes password">
<h2><?php __("Create New Password")?></h2>
<?php echo $form->create('Hash',array('action'=>'hash1','url'=>'hash1/'.$hash['Hash']['hash']));?>
<fieldset>
<legend><?php __('Create New Password');?></legend>
    <div class="fieldset-inside">
     <p class="instructions">
      <?php echo ' <span class="viewtitle">'.$title1['Title']['long_name'].' '.$d['User']['name'].'</span><br/>'; ?>
     <?php strtotime($hash['Hash']['due_date']) > strtotime(date('Y-m-d H:i:s')) ? $expired=false : $expired=true;
               
        if($expired ||$hash['Hash']['limit']<=$hash['Hash']['limit_count']) {
            If ($expired ){
                echo __("You can no longer create a new password. It is past due date:",true).' '.date(Configure::read('date_format'),strtotime($hash['Hash']['due_date']));
                echo "<br/>";
        } 
        If ($hash['Hash']['limit']<=$hash['Hash']['limit_count']){
                echo __("You had used this link. ",true);
                echo "<br/>";
                }
                echo __("Please make a new request again if you want to create another new password.",true);
                echo "<br/><br/>";
                echo $html->link(__("Forgot your password?",true),array('controller'=>'users','action'=>'forgotpass'),array('class'=>'button'));                    
                echo "&nbsp;";
            }
            else{   
            echo __("Please create new password before this due date:",true).' '.date(Configure::read('date_format'),strtotime($hash['Hash']['due_date']));
        echo "<p>&nbsp;</p>"; ?>
    <?php __("Please set your new password.")?> 
    </p>

    <div class="input text">
    <label for="newpassword"><?php __('New Password');?></label>
    <?php echo $form->password('newpassword',array('class'=>'required','error'=>array(
        'alphaNumeric'=>__("Alphabets and numbers only",true),
        'minLength'=>__("Minimum length is 4",true)
        ))); ?> 
    </div>

    <div class="input text">
    <label for="confirmpassword"><?php __('Confirm Password');?></label>
    <?php echo $form->password('confirmpassword', array('class'=>'required','error'=>array(
        'alphaNumeric'=>__("Alphabets and numbers only",true),
        'minLength'=>__("Minimum length is 4",true)
        ))); ?> 
        
                
    </div>
    </div>
</fieldset>
<?php echo $form->button(__('Submit', true),array('type'=>'submit'));?>&nbsp;
<?php echo $form->hidden('hash_type', array('value'=>$hash['Hash']['hash_type']));?>
<?php echo $form->hidden('user_id', array('value'=>$d['User']['id']));?>
<?php } ?>
<?php echo $form->button(__('Cancel', true), array('type'=>'button', 'onclick'=>"parent.location=".$html->url('/')));?>
<?php echo $form->end();?>
</form>
</div>
